#include "system.h"

void system_init(void)
{
    GPIOC->ODR |= 0x00ff;
    GPIOC->ODR &= 0xffff;

    GPIOD->BSRR |= 0x01 << 2;
    GPIOD->BRR |= 0x01 << 2;

    I2CInit();
    time_alarm.Hours = 12;
    time_alarm.Minutes = 0;
    time_alarm.Seconds = 0;

    AT24C02_Read_data(0,&RTC_set_count,1);
    AT24C02_Read_data(1, &alarm_set_count, 1);
    AT24C02_Read_data(2, alarm_aray, 3);

    time_alarm.Hours = alarm_aray[0];
    time_alarm.Minutes = alarm_aray[1];
    time_alarm.Seconds = alarm_aray[2];
}
